﻿using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Microsoft.Practices.EnterpriseLibrary.Validation.Validators;

namespace Metro.Kashikoi.ServiceContract.Item
{
    /// <summary>
    ///  Provides the abstract base class for the item detail.
    /// </summary>
    [DataContract(IsReference = true)]
    [Table("StockItems")]
    public class StockItem : Item
    {
        /// <summary>
        /// Gets or sets the generic name.
        /// </summary>
        /// <value>
        /// The generic name.
        /// </value>
        [DataMember]
        public string GenericName { get; set; }

        /// <summary>
        /// Gets or sets the brand name.
        /// </summary>
        /// <value>
        /// The vrand name.
        /// </value>
        [DataMember]
        public string BrandName { get; set; }

        /// <summary>
        /// Gets or sets the alternat name.
        /// </summary>
        /// <value>
        /// The alternat name.
        /// </value>
        [DataMember]
        public string AlternatName { get; set; }

        /// <summary>
        /// Gets or sets the vendor code.
        /// </summary>
        /// <value>
        /// The vendor code.
        /// </value>
        [DataMember]
        public string VendorCode { get; set; }

        /// <summary>
        /// Gets or sets the unit cost.
        /// </summary>
        /// <value>
        /// The unit cost.
        /// </value>
        [DataMember]
        [Range(0, double.MaxValue)]
        [RangeValidator(0, RangeBoundaryType.Inclusive, double.MaxValue, RangeBoundaryType.Inclusive)]
        public double UnitCost { get; set; }

        /// <summary>
        /// Gets or sets the charge code.
        /// </summary>
        /// <value>
        /// The charge code.
        /// </value>
        [DataMember]
        public string ChargeCode { get; set; }

        /// <summary>
        /// Gets or sets the charge amount.
        /// </summary>
        /// <value>
        /// The charge amount.
        /// </value>
        [DataMember]
        [Range(0, double.MaxValue)]
        [RangeValidator(0, RangeBoundaryType.Inclusive, double.MaxValue, RangeBoundaryType.Inclusive)]
        public double ChargeAmount { get; set; }

        /// <summary>
        /// Gets or sets the size of the pack.
        /// </summary>
        /// <value>
        /// The size of the pack.
        /// </value>
        [DataMember]
        [Range(1, int.MaxValue)]
        [RangeValidator(1, RangeBoundaryType.Inclusive, int.MaxValue, RangeBoundaryType.Inclusive)]
        public int PackSize { get; set; }
    }
}
